]> dgit.raspbian.org Git - ostree.git/commitdiff
ci: Sync Rust linting checks from bootc-dev/bootc
authorXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 03:39:04 +0000 (11:39 +0800)
committerXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 03:39:04 +0000 (11:39 +0800)
Align with bootc's validate target:
- Make cargo clippy gating (was "non-gating") with the same lint config
  as bootc (-A clippy::all -D clippy::correctness -D clippy::suspicious
  -Dunused_imports -Ddead_code)
- Extend clippy to cover test crates (tests/inst, tests/bootc-integration,
  tests/xtask)
- Add cargo doc with -D warnings to catch rustdoc issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
.github/workflows/rust.yml

index 1e7688638e2d41682fc88b889ff60d56d33b770c..5f8b8bf0f707e07ddc6997db43f5dfd4cfd2bfcb 100644 (file)
@@ -33,8 +33,15 @@ jobs:
         run: cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
       - name: Run tests
         run: cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }}
-      - name: cargo clippy (non-gating)
-        run: cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }}
+      - name: cargo clippy
+        run: |
+          CLIPPY_CONFIG="-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code"
+          cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} -- $CLIPPY_CONFIG
+          for d in tests/inst tests/bootc-integration tests/xtask; do
+            cargo clippy --manifest-path $d/Cargo.toml -- $CLIPPY_CONFIG
+          done
+      - name: cargo doc
+        run: env RUSTDOCFLAGS='-D warnings' cargo doc --lib -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }}
   build-no-features:
     runs-on: ubuntu-latest
     container: quay.io/coreos-assembler/fcos-buildroot:testing-devel